package com.hmall.order.ctroller;




import com.hmall.common.dto.ResultDTO;

import com.hmall.order.pojo.Order;
import com.hmall.order.pojo.OrderDetail;
import com.hmall.order.pojo.OrderPaers;
import com.hmall.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
//@RequestMapping
public class OrderController {
    @Autowired
    private OrderService orderService;

    @PostMapping("order")
    Long getOderRequset(@RequestBody OrderPaers orderPaer) {
       return orderService.getOderRequset(orderPaer);
    }

    @PutMapping("/pay/{orderId}")
    public ResultDTO userLoginPayment(@PathVariable("orderId")Long id,@RequestBody String password){
        return orderService.userLoginPayment(id,password);

    }

    // 订单回显
    @GetMapping("/order/{id}")
    public Order findOrderById(@PathVariable("id") Long id){
        return orderService.findOrderById(id);
    }

}
